<?php

/*
 * Elaboraco Por: Ebrain Cedeno.
 */

//cargando el archivo de configuracion del sistema

$config = 'config'.DIRECTORY_SEPARATOR;
include $config."main.php";

$base = 'base'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR;

include $base.'class.Templete.inc.php';
include $base.'class.Controller.inc.php';
include $base.'class.TWidget.inc.php';

$directory = array_diff(scandir($base), array('.','..','index.php','class.Controller.inc.php','class.Templete.inc.php','class.TWidget.inc.php'));

foreach ($directory as $llave=>$class_php){
    include $base.$class_php;
}

//creando los modelos creados por el usuario

$model = 'model'.DIRECTORY_SEPARATOR;
$directory_model = array_diff(scandir($model), array('..','.','index.php'));

foreach ($directory_model as $llave=>$content_model){
    include $model.$content_model;
}

//cargando los controladores creados por el usuario

$controllers = 'controller'.DIRECTORY_SEPARATOR;
$directory_controllers = array_diff(scandir($controllers), array('.','..','index.php'));

foreach ($directory_controllers as $llave=>$content_controllers){
    include $controllers.$content_controllers;
}

//conectando a la base de datos

ActiveRecord::$host = $configure["data_base"]["host"];
ActiveRecord::$user = $configure["data_base"]["user"];
ActiveRecord::$passwd = $configure["data_base"]["passwd"];
ActiveRecord::$port = $configure["data_base"]["port"];
ActiveRecord::$dbname = $configure["data_base"]["dbname"];
ActiveRecord::$type = $configure["data_base"]["type"];

?>
